home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / ixemul / sdk / man / cat2 / msgsnd.0 < prev    next >
Encoding:
Text File  |  1998-06-15  |  3.7 KB  |  89 lines

  1.  
  2. MSGSND(2)                  UNIX Programmer's Manual                  MSGSND(2)
  3.  
  4. NNAAMMEE
  5.      mmssggssnndd - send a message to a message queue
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  9.      ##iinncclluuddee <<ssyyss//iippcc..hh>>
  10.      ##iinncclluuddee <<ssyyss//mmssgg..hh>>
  11.  
  12.      _i_n_t
  13.      mmssggssnndd(_i_n_t _m_s_q_i_d, _v_o_i_d _*_m_s_g_p, _s_i_z_e___t _m_s_g_s_z, _i_n_t _m_s_g_f_l_g)
  14.  
  15. DDEESSCCRRIIPPTTIIOONN
  16.      The mmssggssnndd() function sends a message from the message queue specified in
  17.      _m_s_q_i_d. _m_s_g_p points to a structuer containing the message. This structure
  18.      should consist of the following members:
  19.  
  20.          long mtype;    /* message type */
  21.          char mtext[1]; /* body of message */
  22.  
  23.      _m_t_y_p_e is an integer greater than 0 that can be used for selecting mes-
  24.      sages (see msgrcv(2)),  _m_t_e_x_t is an array of bytes, with a size up to
  25.      that of the system limit (MSGMAX).
  26.  
  27.      If the number of bytes already on the message queue plus _m_s_g_s_z is bigger
  28.      than the maximum number of bytes on the message queue ( _m_s_g___q_b_y_t_e_s, see
  29.      msgctl(2)),  or the number of messages on all queues system-wide is al-
  30.      ready equal to the system limit, _m_s_g_f_l_g determines the action of
  31.      mmssggssnndd().  If _m_s_g_f_l_g has IPC_NOWAIT mask set in it, the call will return
  32.      immediately. If _m_s_g_f_l_g does not have IPC_NOWAIT set in it, the call will
  33.      block until:
  34.  
  35.      ++oo   The condition which caused the call to block does no longer exist.
  36.          The message will be sent.
  37.  
  38.      ++oo   The messag queue is removed, in which case -1 will be returned, and
  39.          _e_r_r_n_o is set to EINVAL.
  40.  
  41.      ++oo   The caller catches a signal. The call returns with _e_r_r_n_o set to EIN-
  42.          TR.
  43.  
  44.      After a successful call, the data structure associated with the message
  45.      queue is updated in the following way:
  46.  
  47.      ++oo   _m_s_g___c_b_y_t_e_s is incremented by the size of the message.
  48.  
  49.      ++oo   _m_s_g___q_n_u_m is incremented by 1.
  50.  
  51.      ++oo   _m_s_g___l_s_p_i_d is set to the pid of the calling process.
  52.  
  53.      ++oo   _m_s_g___s_t_i_m_e is set to the current time.
  54.  
  55. RREETTUURRNN VVAALLUUEESS
  56.      Upon successful completion, 0 is returned. Otherwise, -1 is returned and
  57.      _e_r_r_n_o is set to indicate the error.
  58.  
  59. EERRRROORRSS
  60.      mmssggssnndd() will fail if:
  61.  
  62.      [EINVAL]      _m_s_q_i_d is not a valid message queue identifier
  63.  
  64.                    The message queue was removed while mmssggssnndd() was waiting
  65.                    for a resource to become available in order to deliver the
  66.                    message.
  67.  
  68.                    _m_s_g_s_z is less than 0, or greater than _m_s_g___q_b_y_t_e_s.
  69.  
  70.      [EACCESS]     The calling process does not have write access to the mes-
  71.                    sage queue.
  72.  
  73.      [EAGAIN]      There was no space for this message either on the queue, or
  74.                    in the whole system, and IPC_NOWAIT was set in _m_s_g_f_l_g.
  75.  
  76.      [EFAULT]      _m_s_g_p points to an invalid address.
  77.  
  78.      [EINTR]       The system call was interrupted by the delivery of a sig-
  79.                    nal.
  80.  
  81. BBUUGGSS
  82.      NetBSD does not define the EIDRM error value, which should be used in the
  83.      case of a removed message queue.
  84.  
  85. HHIISSTTOORRYY
  86.      Message queues appeared in the first release of AT&T Unix System V.
  87.  
  88.  NetBSD                         August 17, 1995                              2
  89.